home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
DDJMAG
/
DDJ9207.ZIP
/
LETTERS.ASC
< prev
next >
Wrap
Text File
|
1992-06-15
|
2KB
|
99 lines
_LETTERS_
[LISTING ONE]
void PatchSFT ( void )
{ char *sft,
*next_sft;
unsigned num_files;
int found;
// get first SFT block
_AH = 0x52;
geninterrupt ( 0x21 );
sft = * (char ** ) MK_FP ( _ES, _BX + 4 );
// searchthru till end of block chain
while ( sft != ( char * ) 0x0000ffff ) {
next_sft = * ( char ** ) sfrt;
// each block indicates the
// number of elements within
num_files = * ( int * ) ( sft + 4 );
sft += 6;
// search thru this block's
// elements looking for match
do {
found = strncmp ( drvptr + 10, sft + 32, 8 );
sft += _osmajor < 4 ? 53 : 59 ;
} while ( --num-files && found !+ 0 );
sft = next_sft;
}
if ( found == 0 ) {
( char ** ) ( sft + 7 ) = drvptr;
( unsigned * ) ( sft + 11) = FP_OFF ( drvptr );
}
}
[LISTING TWO]
; as generated by SoundBlaster as a pulse width
; modulated signal on the internal IBM speaker,
VoiceTrkParms struc
dw 4 dup (?) ; pushed BP, ES and return address
StartOffset dw ? ; offset of address of voice track buffer
StartSegment dw ? ; segment address of voice track buffer
;StartOffset dw ? ; offset of address of voice track buffer
TrackLength dw ? ; Length of voice track
VoiceTrkParms ends
.model large
.code
public _VoiceTrk
_VoiceTrk proc far
push bp
push es
mov bp,sp
mov si,StartOffset[bp]
mov es,StartSegment[bp]
mov cx,TrackLength[bp]
in al,61h
push ax
mov ah,1Fh
and al,0FCh
out 61h,al
mov bp,0
cli
OuterLoop:
mov dh,0
mov dl,es:[si+bp]
test dl,ah
jz InnerLoop
or al,2
out 61h,al
InnerLoop:
cmp dl,dh
jne NoShutDown
and al0FCh
out 61h,al
NoShutDown:
inc dh
cmp dh,32
jne InnerLoop
inc bp
loop OuterLoop
sti
pop ax
out 61h,al
pop es
pop bp
retf
_VoiceTrk endp
end